package com.yingxin.yx.framework.commons.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 往来单位  是否本公司  枚举
 */

public enum ContactUnitsType {

    A("A","公司"),
    B("B","个人"),
    ;

    private String type;

    private String typeName;


    ContactUnitsType(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;

    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }


    public static ContactUnitsType getEnum(String type) {
        if ( StringUtils.isBlank( type ) ) {
            return null;
        }
        for (ContactUnitsType i : ContactUnitsType.values()) {
            if ( i.getType().equals( type ) ) {
                return i;
            }
        }
        return null;
    }

}
